#ifndef MODEL_H_
#define MODEL_H_

#include "NetworkEvent.h"

#include <tr1/memory>

class Model
{
public:
    Model();
    virtual ~Model();

    virtual void collectChanges(NetworkEvents& events);
    virtual void traverse(const Event& event);
    long getId();

protected:
    virtual void handleEvent(const Event& event);
    virtual void addChangeEvent(NetworkEvent* event);
    virtual void addChangeEvent(NetworkEvent* event, int playerId);

    long id;

private:
    static long idCounter;
    NetworkEvents eventsToSend;
};

typedef std::tr1::shared_ptr<Model> ModelPtr;

#endif
